﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Cryptography;

/// <summary>
/// this class for hashing the password to md5
/// </summary>
public class LMSSecurity
{
	

    /// <summary>
    /// this function will take a string and convert it to hashed hexadecimal
    /// </summary>
    /// <param name="strIn">the string to hash</param>
    /// <returns>the hashed string</returns>
    public static string HashPassword(string strIn)
    {
        string strRet = "";
        MD5 mdnew = MD5.Create();
        byte[] btNew = System.Text.UnicodeEncoding.Unicode.GetBytes(strIn);
        byte[] btHashed = mdnew.ComputeHash(btNew);
        strRet = BitConverter.ToString(btHashed).Replace("-", "");




        return strRet;
    }
}
